<!--师傅月报评分-->
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
		<meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
		<title>管理评师傅端报告评价页</title>
		<link rel="stylesheet" href="../../css/mui.min.css" />
		<link rel="stylesheet" href="../../css/base.css"/>
		<link rel="stylesheet" type="text/css" href="../../css/weui.min.css">
		<link rel="stylesheet" type="text/css" href="../../css/attachmentCss.css">
		<style type="text/css" media="screen">
			.title {
				font-size: 14px;
			}
			.summary_div .feeling {
				padding-bottom: 1px;
			}
			.feeling {
				border-bottom: 1px solid #ededed;
			}
			.title {
				border-left: unset;
			}
			.score_div .feeling-text {
				/*text-indent: 2em;*/
				background-size: 16px;
				margin-top: 15px;
				margin: 10px;
			}
			.score_div .feeling-text p {
				color: #646464;
				padding: 2px 2px;
			}
			.bottom_btn_div {
				color: #FFF;
				height: 45px;
				width: 100%;
				z-index: 995;
				border-top: 1px solid #d9d9d9;
				position: fixed;
				bottom: 0px;
				left: 0px;
				text-align: center;
				margin-top: 23px;
			}
			.bottom_btn_div a {
				line-height: 45px;
				font-size: 14px;
				background: #18b4ed;
				width: 100%;
				color: #FFF;
			}
			.content_div {
				margin-top: 66px
			}
			.comment_div {
				padding-right: 20px;
				margin-top: 10px
			}
			.score_div .feeling-text {
				text-indent: 2em;
				background-size: 16px;
				margin-top: 15px;
				margin: 10px;
			}
			.score_div .feeling-text p {
				color: #646464;
				padding: 2px 2px;
			}
			.score_div {
				padding: 2px 5px;
				background: #fff
			}
			.star_score_div {
				padding: 10px;
			}
			.myScore-starscore {
				font-size: 14px;
				color: #646464;
				margin-left: 15px;
			}
			.star_score_div	.myScore-starscore .star img {
				margin-left: 3%;
				width: 18px;
			}
			.star_score_div	.top {
				margin-top: 10px;
			}
			.star {
				width: 67%;
			}
			.left {
				float: left;
			}
			.letter {
				width: 85px;
				line-height: 15px;
				padding: 4px 0px
			}
			.title img {
				height: 20px;
				padding-top: 4px
			}
			.summary_title {
				display: inline-block;
				background: url(../../icon/icon_summary_title.png) no-repeat left center;
				background-size: 20px;
				padding-left: 25px
			}
			.comment_title {
				display: inline-block;
				background: url(../../icon/icon_comment_title.png) no-repeat left center;
				background-size: 16px;
				padding-left: 25px
			}
			.grade_title {
				display: inline-block;
				background: url(../../icon/icon_grade_title.png) no-repeat left center;
				background-size: 16px;
				padding-left: 25px
			}
			.attachment_title {
				display: inline-block;
				background: url(../../icon/icon_attachment.png) no-repeat left center;
				background-size: 20px;
				padding-left: 25px;
			}
			.padding25 {
				padding-left: 3px
			}
			.top_title {
				margin-top: 66px
			}
			.writeReport .ReviewWeekly_div {
				margin-top: 0px;
			}
			.attachment_div {
				padding-left: 10px;
				padding-right: 8px;
			}
			.weui_cells:after {
				border-bottom: unset;
			}
		</style>
	</head>
	<body>
		<div class="base_style_color base_title_Immerse" id='BarAppearance' ></div>
		<div class="base_navigation_bar base_style_color base_navigation_item_bar base_title_position" >
			<a class="base_left_item" href="#" onclick="backClick()"> <img class="base_back_icon" src="../../image/icon_jiantou.png" alt=""> </a>
			<span id="stu_name">张三的月报</span>
			<a class="base_right_item nav-item" id="wancheng"> </a>
		</div>
		<div class=" writeReport content_div">
			<div class="ReviewWeekly_div top_54 summary_div">
				<div class="feeling">
					<p class="title summary_title" >
						工作总结
					</p>
				</div>
				<div class="score_div">
					<div class="feeling-text">
						<p id="summary" style=" word-break: break-all">
							<!--蒙雷亚尔和穆斯塔菲没能将球解围干净，防守中的低级失误让纽卡重新取得领先，自2018年以来，阿森纳在联赛中客场还没有取得过1个积分。从数据端，穆斯塔菲可谓表现抢眼，全场10次头球争顶，可在关键时候，他却屡屡犯错。-->
						</p>
					</div>
				</div>
			</div>
				<div class="ReviewWeekly_div summary_div"   id="attachment_div" style="display: none">
				<div class="feeling" style="border-bottom: unset">
					<p class="title attachment_title" style="margin-bottom:0;	">
						附件
					</p>
				</div>
				<div class="feeling-text top_5 left_15" hidden="hidden" id="nullImg">
					<p>
						无
					</p>
				</div>
				<div id="attachmentTableView" class="weui_cells fileDownLoad_Div"></div>
				<div class="blank"></div>
			</div>
			<div class="ReviewWeekly_div top_10 comment_content_div">
				<div class="feeling" style="padding-bottom: 1px;">
					<p class="title comment_title" >
						评语
					</p>
				</div>
				<div class="feeling comment_div" style="border-bottom: unset;margin-bottom: -16px">
					<textarea id="comment" style="border:1px solid #d9d9d9;" placeholder='字数不得少于5个字'></textarea>
				</div>
			</div>
		
			<div class="ReviewWeekly_div top_54 summary_div" style="margin-bottom: 66px;border-top: unset">
				<div class="feeling">
					<p class="title grade_title" >
						评分
					</p>
				</div>
				<div class="star_score_div">
					<div class="myScore-starscore clearfix ">
						<div class="letter left">
							工作能力：
						</div>
						<div class="star left" id="taiduNum">
							<img src="../../image/icon_xingxingblue01.png">
							<img src="../../image/icon_xingxingblue01.png">
							<img src="../../image/icon_xingxingblue01.png">
							<img src="../../image/icon_xingxingblue01.png">
							<img src="../../image/icon_xingxingblue01.png">
							<img src="../../image/icon_xingxingblue01.png" hidden="hidden">
						</div>
					</div>
					<div class="myScore-starscore clearfix top">
						<div class="letter left">
							工作态度：
						</div>
						<div class="star left" id="chuqinNum">
							<img src="../../image/icon_xingxingblue01.png">
							<img src="../../image/icon_xingxingblue01.png">
							<img src="../../image/icon_xingxingblue01.png">
							<img src="../../image/icon_xingxingblue01.png">
							<img src="../../image/icon_xingxingblue01.png">
							<img src="../../image/icon_xingxingblue01.png" hidden="hidden">
						</div>
					</div>
					<div class="myScore-starscore clearfix top">
						<div class="letter left">
							职业素养：
						</div>
						<div class="star left" id="gzwcdNum">
							<img src="../../image/icon_xingxingblue01.png">
							<img src="../../image/icon_xingxingblue01.png">
							<img src="../../image/icon_xingxingblue01.png">
							<img src="../../image/icon_xingxingblue01.png">
							<img src="../../image/icon_xingxingblue01.png">
							<img src="../../image/icon_xingxingblue01.png" hidden="hidden">
						</div>
					</div>
					<div class="myScore-starscore clearfix top">
						<div class="letter left">
							沟通能力：
						</div>
						<div class="star left" id="jnzwdNum">
							<img src="../../image/icon_xingxingblue01.png">
							<img src="../../image/icon_xingxingblue01.png">
							<img src="../../image/icon_xingxingblue01.png">
							<img src="../../image/icon_xingxingblue01.png">
							<img src="../../image/icon_xingxingblue01.png">
							<img src="../../image/icon_xingxingblue01.png" hidden="hidden">
						</div>
					</div>
				</div>
			</div>
			<div class="bottom_btn_div" id="sub_div" onclick="sumbit()">
				<a>提交</a>
			</div>
		</div>
	</body>
	<script src="../../script/jquery.min.js" type="text/javascript"></script>
	<script type="text/javascript" src="../../script/api.js"></script>
	<script type="text/javascript" src="../../script/MD5.js"></script>
	<script type="text/javascript" src="../../script/common.js"></script>
	<script type="text/javascript" src="../../script/timeStampTool.js"></script>
	<script type="text/javascript" src="../../script/requestTool.js"></script>
	<script type="text/javascript" src="../../script/databaseOperation.js"></script>
	<script src="../../script/attachmentManager.js"></script>
	<script type="text/javascript" src="../../script/base64.min.js"></script>
	<script type="text/javascript" src="../../script/copyTool.js"></script>
	<script type="text/javascript">
		var sxtdScore = 0;
		var cqlScore = 0;
		var gzwcdScore = 0;
		var gzwcdScore = 0;
		var comment = '';
		var parten = /^\s*$/;
		var stuid = '';
		var id = '';
		DBReady = function() {
			showProgress();
			loadData();
			setupDownloadAttNotifi();
			setupStarClick();
			listenScroll();
			sendBuriedNotifi('0', '师傅端报告批改页', '243');
		}
		function sendBuriedNotifi(busionessid, pagetype, pagetypeid) {
			var userinfo = {
				uid : $api.getStorage('cfnetppuid'),
				jid : $api.getStorage('cfnetppjid'),
				uname : $api.getStorage('cfnetppusername'),
			}
			var data = {
				busionessid : busionessid,
				pagetype : pagetype,
				pagetypeid : pagetypeid,
				sourceurl : api.pageParam.sourceurl,
				sourcetitle : api.pageParam.sourcetitle,
				accesspageurl : window.location.pathname,
				accesspagetitle : document.title,
				userinfo : userinfo
			}
			SendBehaviorTrajectoriesNotifi_Study(data);
		}

		// 滚动监听
		function listenScroll() {
			var winHeight = $(window).height();
			$(window).resize(function() {
				var thisHeight = $(this).height();
				if (winHeight - thisHeight > 50) {
					//当软键盘弹出，在这里面操作
					$("#sub_div").css('display', 'none');
				} else {
					$("#sub_div").css('display', 'block');
					//当软键盘收起，在此处操作
				}
			});
		}

		//获取数据
		function loadData() {
			var param = {
				id : api.pageParam.id, 
				is : 1
			};
//			 alert("统计分析"+JSON.stringify(param));
			cfnetppPOST(url_sfinfo, param, true, function(data, status) {
			hideProgress();
				if (status == 'success') {
					if (data.status == 1) {
						var dataArr = data.json;
						if (dataArr != null) {
							name = dataArr.rename1;
							$('#summary').text(Base64.decode(dataArr.summary));
							$('#stu_name').text(name + '的月报');
							var urldata = dataArr.urldata;
							if (urldata != null && urldata != '') {
								$('#attachment_div').show();
							}
							var arr = new Array();
							for (var i = 0; i < urldata.length; i++) {
								var monthData = urldata[i];
								var data = {
									id : monthData.id,
									url : monthData.enclosureurl,
									size : monthData.enclosuresize,
									name : monthData.enclosurename,
								};
								arr.push(data);
							}
							saveAttDatasToDb(arr, '');
						} else {
							api.toast({
								msg : '获取数据失败',
								duration : 2000,
								location : 'bottom'
							});
						}
					} else {
						api.toast({
							msg : '获取数据失败',
							duration : 2000,
							location : 'bottom'
						});
					}
				} else {
					api.toast({
						msg : '网络连接失败',
						duration : 2000,
						location : 'bottom'
					});
				}
			});
		}

		//提交数据
		function sumbit() {
			var com = $('#comment').val();
			if (com.length == 0 || com == null || parten.test(com)) {
				ShowToast('提交信息不完整，请完善信息后再次提交');
			} else if (com.length < 5) {
				ShowToast('评语的长度不能小于5个字符');
			} else if (sxtdScore == 0 || cqlScore == 0 || gzwcdScore == 0 || jnzwdScore == 0) {
				ShowToast('你还未评分完成，请评分');
			} else {
				showProgress();
				var param = {
					reportid : api.pageParam.id,
					jid : $api.getStorage('cfnetppjid'),
					stuid : api.pageParam.uid,
					sfid : $api.getStorage('cfnetppuid'),
					qcomment : Base64.encode(com),
					qsxtd : sxtdScore, //实习态度(返回分值最高10分)
					qcql : cqlScore, //出勤率
					qgzwcd : gzwcdScore, //工作完成度
					qjnzwd : jnzwdScore, //技能掌握度
					is : 1 ,
				};
				// console.log(JSON.stringify(param)+'\n'+urlmasterssfevaluate);
				cfnetppPOST(url_sfevaluate, param, false, function(data, status) {
					SendBusinessOperationsLogNotifi('师傅端报告批改', '243', param, param, '', data, '师傅端报告批改接口', '243-01')
					hideProgress();
					if (status == 'success') {
						hideProgress();
						if (data.status == 1) {
							ShowToast('评价成功');
							sendNotifi();
							backClick();
						} else {
							ShowToast('提交失败，请重试');
						}
					} else {
						ShowToast('提交失败，请重试');
					}
				});
			}
		}

		//点击星星
		function setupStarClick() {
			$('.star img').each(function(i) {
				$(this).click(function() {
					$(this).attr('src', '../../image/icon_xingxingblue.png');
					$(this).prevAll().attr('src', '../../image/icon_xingxingblue.png');
					$(this).nextAll().attr('src', '../../image/icon_xingxingblue01.png');
					var score = ($(this).prevAll().length + 1) * 20;
					if ($(this).parent().attr('id') == 'taiduNum') {//实习态度
						sxtdScore = score;
					} else if ($(this).parent().attr('id') == 'chuqinNum') {//出勤率
						cqlScore = score;
					} else if ($(this).parent().attr('id') == 'gzwcdNum') {//工作完成度
						gzwcdScore = score;
					} else if ($(this).parent().attr('id') == 'jnzwdNum') {//技能掌握度
						jnzwdScore = score;
					}
				})
			});
		}

		//发送通知
		function sendNotifi() {
			api.sendEvent({
				name : 'MasterReportListNotifi'
			});
		}

		//退出页面
		function backClick() {
			sendBuriedNotifi('1', '师傅端报告批改页', '243');
			api.closeWin({
			});
		}
	</script>
</html>